<%@ page language="java" import="java.util.*,com.hs.dict.model.*,com.hs.core.utils.*,com.hs.core.cache.*" pageEncoding="utf-8"%>
<%
  HsCode  obj = (HsCode)request.getAttribute("obj");
 String flag = (String)request.getAttribute("flag");

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>
<title></title>
<%@ include file="../include.jsp"%>   
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/My97DatePicker/WdatePicker.js"></script>

<style>.tac{text-align:center}</style>
 <script language="javascript" type="text/javascript">
   function saveData(flag){
       var dictcode = DWRUtil.getValue("dictcode");
       var dictname = DWRUtil.getValue("dictname");
       var dicttype = DWRUtil.getValue("dicttype");
       var dictnum = DWRUtil.getValue("dictnum");
       if(isNull(dictcode)){
         alert("请输入字典编码");
       	 form1.dictcode.focus();
       	 return ;
       }
        
       form1.submit();
       
    
    } 
    function callback4save(message){
       alert(message);  
       opener.document.location.replace(opener.document.location.href);
    }
 </script>
</head>
<body>
<div class="contlist"> 
<form name="form1" action="<%=basePath %>dict/saveDict.do" method="post">
    <table border="0" cellspacing="0" cellpadding="0" align=center width="99%" class="tableList">
     <caption><font size=3>数据字典信息维护</font></caption> 
      <tr>
        <td width="25%">字典代码：</td>
        <td  colspan=3 nowrap> 
        <input type="text" name="dictcode"   style="width:95%" value="<%=obj==null?"":obj.getDictcode() %>" />
            <input type="hidden" name="id" class="input_1" style="width:98%" value="<%=obj==null?"":obj.getId() %>" />
        </td> 
      </tr>
        <tr>
        <td width="25%">字典名称：</td>
        <td  colspan=3 nowrap> 
       <input type="text" name="dictname"   style="width:95%" value="<%=obj==null?"":obj.getDictname()==null?"":obj.getDictname() %>" />
        </td> 
      </tr>
         <tr>
        <td width="25%">字典类型：</td>
        <td  colspan=3 nowrap> 
                            <%out.println(DictCacheUtil.getInst().selectStrNodefault("dicttype","width:95%",obj==null?"":(obj.getDicttype()+""),"1"));%>
        </td> 
      </tr>
         <tr>
        <td width="25%"> 字典序号：</td>
        <td  colspan=3 nowrap> 
                            <input type="text" name="dictnum"   style="width:95%" value="<%=obj==null?"":obj.getOrdnum() %>" />
        </td> 
      </tr>
       <tr>
        <td width="25%">是否默认值：</td>
        <td  colspan=3 nowrap> 
                            <input type="checkbox" name="isdefault"   value="1" <%if("1".equals(obj==null?"":obj.getIsdefault())){out.print(" checked");} %>/>是否默认值
        </td> 
      </tr>
      <tr>
        <td colspan=4 align="center"> 
        	<input name="" type="button" value="保存" onclick="saveData();" class="btn btn-primary" />
        </td> 
      </tr> 
    </table>  
</form>
</div>
</body>
</html> 
<script>
<%if(null!= flag){ %> 
    alert("保存成功！");
     window.parent.dictmain.frameElement.src =  window.parent.dictmain.frameElement.src; 
<%}%>
</script>
